package com.twu.exercise;

public class RightTriangle {
    private String separator = System.getProperty("line.separator");

    public String print(int number) {
        StringBuilder result = new StringBuilder();
        for (int index = 0; index < number; index++) {
            result = result.append(printAsterisk(index) + separator);
        }
        return result.toString();
    }

    private String printAsterisk(int amount) {
        StringBuilder result = new StringBuilder();
        for (int index = 0; index < amount + 1; index++) {
            result = result.append("*");
        }
        return result.toString();
    }
}
